use super::crypt_algid::CRYPT_RAND_AlgId;
use super::crypt_types::{CRYPT_EAL_LibCtx, CRYPT_RandSeedMethod};
use crate::bsl::bsl_params::BSL_Param;
pub type CRYPT_EAL_RandFunc =
    ::std::option::Option<unsafe extern "C" fn(rand: *mut u8, randLen: u32) -> i32>;
unsafe extern "C" {
    pub fn CRYPT_EAL_SetRandCallBack(func: CRYPT_EAL_RandFunc);
}
pub type CRYPT_EAL_RandFuncEx = ::std::option::Option<
    unsafe extern "C" fn(ctx: *mut ::std::os::raw::c_void, rand: *mut u8, randLen: u32) -> i32,
>;
unsafe extern "C" {
    pub fn CRYPT_EAL_SetRandCallBackEx(func: CRYPT_EAL_RandFuncEx);
}
unsafe extern "C" {
    pub fn CRYPT_EAL_RandInit(
        id: CRYPT_RAND_AlgId,
        seedMeth: *mut CRYPT_RandSeedMethod,
        seedCtx: *mut ::std::os::raw::c_void,
        pers: *const u8,
        persLen: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_ProviderRandInitCtx(
        libCtx: *mut CRYPT_EAL_LibCtx,
        algId: i32,
        attrName: *const ::std::os::raw::c_char,
        pers: *const u8,
        persLen: u32,
        param: *mut BSL_Param,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_RandDeinit();
}
unsafe extern "C" {
    pub fn CRYPT_EAL_RandDeinitEx(libCtx: *mut CRYPT_EAL_LibCtx);
}
unsafe extern "C" {
    pub fn CRYPT_EAL_RandbytesWithAdin(
        byte: *mut u8,
        len: u32,
        addin: *mut u8,
        addinLen: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_RandbytesWithAdinEx(
        libCtx: *mut CRYPT_EAL_LibCtx,
        byte: *mut u8,
        len: u32,
        addin: *mut u8,
        addinLen: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_Randbytes(byte: *mut u8, len: u32) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_RandbytesEx(libCtx: *mut CRYPT_EAL_LibCtx, byte: *mut u8, len: u32) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_RandSeedWithAdin(addin: *mut u8, addinLen: u32) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_RandSeed() -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_RandSeedEx(libCtx: *mut CRYPT_EAL_LibCtx) -> i32;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct EAL_RndCtx {
    _unused: [u8; 0],
}
pub type CRYPT_EAL_RndCtx = EAL_RndCtx;
unsafe extern "C" {
    pub fn CRYPT_EAL_DrbgNew(
        id: CRYPT_RAND_AlgId,
        seedMeth: *mut CRYPT_RandSeedMethod,
        seedCtx: *mut ::std::os::raw::c_void,
    ) -> *mut CRYPT_EAL_RndCtx;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_ProviderDrbgNewCtx(
        libCtx: *mut CRYPT_EAL_LibCtx,
        algId: i32,
        attrName: *const ::std::os::raw::c_char,
        param: *mut BSL_Param,
    ) -> *mut CRYPT_EAL_RndCtx;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_DrbgDeinit(ctx: *mut CRYPT_EAL_RndCtx);
}
unsafe extern "C" {
    pub fn CRYPT_EAL_DrbgbytesWithAdin(
        ctx: *mut CRYPT_EAL_RndCtx,
        byte: *mut u8,
        len: u32,
        addin: *mut u8,
        addinLen: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_Drbgbytes(ctx: *mut CRYPT_EAL_RndCtx, byte: *mut u8, len: u32) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_DrbgSeedWithAdin(
        ctx: *mut CRYPT_EAL_RndCtx,
        addin: *mut u8,
        addinLen: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_DrbgSeed(ctx: *mut CRYPT_EAL_RndCtx) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_RandIsValidAlgId(id: CRYPT_RAND_AlgId) -> bool;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_DrbgInstantiate(
        ctx: *mut CRYPT_EAL_RndCtx,
        pers: *const u8,
        persLen: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_DrbgCtrl(
        ctx: *mut CRYPT_EAL_RndCtx,
        cmd: i32,
        val: *mut ::std::os::raw::c_void,
        valLen: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_GetSeedCtx(isParentEntropy: bool) -> *mut CRYPT_EAL_RndCtx;
}
